package demo1;

//牛客网:ISBN号码
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int pos = 1;
        long st = 0;
        for(int i = 0; i<s.length()-1; i++) {
            if(s.charAt(i)!='-') st += (s.charAt(i) - '0') * (pos++);
        }
        st %= 11;
        char tal = s.charAt(s.length()-1);
        if(( tal == 'X' && st == 10) || ( tal-'0' == st)) {
            System.out.println("Right");
        }else {
            StringBuffer ret = new StringBuffer(s);
            ret.delete(ret.length()-1,ret.length());
            if(st == 10) {
                ret.append('X');
            }else {
                ret.append((char)(st+'0'));
            }
            System.out.println(ret);
        }
    }
}